<!--
 * @Description: 当前路由的正文视图
 * @Author: wangfuwei
 * @Date: 2020-12-06 19:35:48
 * @LastEditors: wangfuwei
 * @LastEditTime: 2021-01-02 21:11:41
 * @FilePath: /horizon-frontend/src/layouts/PageView.vue
-->
<template>
  <div :style="{ marginTop: '12px' }">
    <slot>
      <a-spin :spinning="spinning">
        <!-- 全部缓存，如有不需缓存的组件，可在组件内部通过监听路由刷新等操作解决  -->
        <keep-alive>
          <router-view :key="$route.fullPath" />
        </keep-alive>
      </a-spin>
    </slot>
  </div>
</template>

<script>
export default {
  name: "PageView",
  props: {
    hasSider: Boolean,
  },
  data() {
    return {
      spinning: false,
    };
  },
};
</script>
